<?php

namespace App\Http\Middleware\Common;

use Closure;
use Illuminate\Support\Facades\Redis;

class LockAfter
{
    /**
     * 单线程锁 - after
     * @param $request
     * @param Closure $next
     * @return mixed
     */
    public function handle($request, Closure $next, string $lockType)
    {
        $response = $next($request);

        $redis_key = LockBefore::getKeyByLockType($lockType);

        Redis::del($redis_key);

        return $response;
    }
}
